package utils

import (
	"coinsend/btc"
)

func CheckAddress(Symbol, Address string) bool {
	if Symbol == "ETH" {
		if len(Address) != 42 || Address[0:2] != "0x" {
			return false
		}
		return true
	} else if Symbol == "BTC" || Symbol == "USDT" {
		ok, v, _ := btc.ValidateAddress([]byte(Address))
		if !(ok && (v == 0 || v == 5)) {
			return false
		}
		return true
	} else if Symbol == "LTC" {
		_, v, _ := btc.ValidateAddress([]byte(Address))
		if v == 48 || v == 50 {
			return true
		}
		return false
	}
	return false
}
